package com.atde._05_behavioral_design_patterns.visitor;


/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._05_behavioral_design_patterns.visitor
 * @Author: Del
 * @CreateTime: 2025-06-26  16:16
 * @Description: 访问者模式
 * @Version: 1.0
 */
public class Client {
    public static void main(String[] args) {
        // 创建 ObjectStructure
        ObjectStructure objectStructure = new ObjectStructure();

        // 创建对象
        Man man = new Man();
        Woman woman = new Woman();

        objectStructure.attach(man);
        objectStructure.attach(woman);

        // 成功
        Success success = new Success();
        objectStructure.display(success);
        System.out.println("----------------------");
        // 失败
        Fail fail = new Fail();
        objectStructure.display(fail);
        System.out.println("----------------------");
        // 待定
        Wait wait = new Wait();
        objectStructure.display(wait);

    }
}
